<div class="edit">
	<%= f.error_messages %>
	<div class="edit-table">
		<div class="edit-row">
			<div class="left">
				<%= f.label :account_name, 'Username' %><span class="required">required</span>
				<p>User account name.</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.text_field :account_name %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :real_name, 'Name' %><span class="required">required</span>
				<p>Who is the user?</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.text_field :real_name %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :email, 'Email' %><span class="optional">(optional)</span>
				<p>What is their email address?</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.text_field :email %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :phone_number, 'Phone Number' %><span class="optional">(optional)</span>
				<p>What is their phone number?</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.text_field :phone_number %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :permission_level, 'Account Type' %>
				<% if @user.new_record? %>
					<span class="required">required</span>
				<% end %>
				<p>Select the user's account type.</p>
			</div>
			<div class="right">
				<div class="single">
					<% # Supervisor can't create an admin %>
					<% @editable_permissions = @supervisor ? User::PermissionLevels - ["admin"] : User::PermissionLevels  %>
					<%= f.select(:permission_level, @editable_permissions.map {|pt| [pt.to_s.capitalize, pt.to_s]}, {:prompt => :true}, {:disabled => !@user.new_record?}) %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :location_id, 'User Location' %>
				<% if @user.new_record? %>
					<span class="optional">optional/required</span>
				<% end %>
				<p>Required only if the user is not a courier.</p>
			</div>
			<div class="right">
				<div class="single">
					<% if !@user.new_record? || @supervisor 	# No editing %>
						<% if !@user.new_record? and @user.location_id.nil? %>
							<% @loc_text = "No Location" %>
						<% else %>
							<%= f.hidden_field :location_id, :value => @current_user.location.id %>
							<% @loc_text = @current_user.location.name %>
						<% end %>
						<%= text_field nil, nil, {:value => @loc_text, :disabled => true} %>
					<% else 	# Editing %>
						<%= f.collection_select :location_id, Location.all, :id, :name, {:selected => @current_user.location.id, :include_blank => "No Location"}%>
					<% end %>
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :password, 'Password' %>
				<% if @user.new_record? %>
					<span class="required">required</span>
				<% else %>
					<span class="optional">(optional)</span>
				<% end %>
				<p>&nbsp;</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.password_field :password %><br />
				</div>
			</div>
		</div>
		<div class="edit-row">
			<div class="left">
				<%= f.label :password_confirmation, 'Confirm Password' %>
				<% if @user.new_record? %>
					<span class="required">required</span>
				<% else %>
					<span class="optional">(optional)</span>
				<% end %>
				<p>&nbsp;</p>
			</div>
			<div class="right">
				<div class="single">
					<%= f.password_field :password_confirmation %><br />
				</div>
			</div>
		</div>
	</div>
</div>